package com.migration.model.olddb;

import jakarta.persistence.*;
import lombok.Data;
import java.time.LocalDateTime;
import java.io.Serializable;

/**
 * 事故链详情表 实体类
 * 表名：ra_fault_chains_detail
 * 自动生成的实体类
 */
@Data
@Entity
@Table(name = "ra_fault_chains_detail")
public class RaFaultChainsDetail implements Serializable {

    private static final long serialVersionUID = 1L;
    
    /**
     * 主键
     * 主键
     */
    @Id
    @Column(name = "id", nullable = false)
    private Long id;
    
    /**
     * 原因主键
     */
    @Column(name = "reason_id", nullable = false)
    private Long reasonId;
    
    /**
     * 项目主键
     */
    @Column(name = "items_id")
    private Long itemsId;
    
    /**
     * 详细步骤主键
     */
    @Column(name = "step_detail_id")
    private Long stepDetailId;
    
    /**
     * 影响主键
     */
    @Column(name = "influence_id")
    private Long influenceId;
    
    /**
     * 当前节点主键
     */
    @Column(name = "current_node_id")
    private Long currentNodeId;
    
    /**
     * 后果主键
     */
    @Column(name = "consequence_id")
    private Long consequenceId;
    
    /**
     * 后果节点
     */
    @Column(name = "consequence_node", length = 32)
    private String consequenceNode;
    
    /**
     * 父类影响主键
     * 默认值: 0
     */
    @Column(name = "parent_id")
    private Long parentId;
    
    /**
     * 层级路径（影响id集合，多个/分隔）
     */
    @Column(name = "parent_path", length = 256)
    private String parentPath;
    
    /**
     * 状态（0、禁用 1、使用）
     * 默认值: 1
     */
    @Column(name = "status")
    private Byte status;
    
    /**
     * 事故链类型（1、连续作业 2、间歇操作 3、JSA操作）
     * 默认值: 1
     */
    @Column(name = "fault_chains_type")
    private Byte faultChainsType;
    
    /**
     * 事故链JSON（key:当前节点序号，val:当前节点颜色）
     */
    @Column(name = "fault_chains_json", length = 1024)
    private String faultChainsJson;
    
    /**
     * 后果序号
     */
    @Column(name = "consequence_sorted", length = 32)
    private String consequenceSorted;
    
    /**
     * 初始风险
     */
    @Column(name = "origin_risk", length = 512)
    private String originRisk;
    
    /**
     * 残余风险
     */
    @Column(name = "remnant_risk", length = 512)
    private String remnantRisk;
    
    /**
     * 建议后
     */
    @Column(name = "after_advise", length = 512)
    private String afterAdvise;
    
    /**
     * 是否删除（0、否1、是）
     * 默认值: 0
     */
    @Column(name = "is_del", nullable = false)
    private Byte isDel;
    
    /**
     * 是否自动带入（0、否 1、是）
     * 默认值: 0
     */
    @Column(name = "is_take_in")
    private Byte isTakeIn;
    
    /**
     * 备注
     */
    @Column(name = "remark", length = 1024)
    private String remark;
    
    /**
     * 租户主键ID
     * 默认值: 1
     */
    @Column(name = "tenant_id", nullable = false)
    private Integer tenantId;
    
    /**
     * 创建时间
     * 默认值: CURRENT_TIMESTAMP
     */
    @Column(name = "create_time", nullable = false)
    private java.time.LocalDateTime createTime;
    
    @Override
    public String toString() {
        return "RaFaultChainsDetail{" +
            "id=" + id +
            ", reasonId=" + reasonId +
            ", itemsId=" + itemsId +
            ", stepDetailId=" + stepDetailId +
            ", influenceId=" + influenceId +
            ", currentNodeId=" + currentNodeId +
            ", consequenceId=" + consequenceId +
            ", consequenceNode=" + consequenceNode +
            ", parentId=" + parentId +
            ", parentPath=" + parentPath +
            ", status=" + status +
            ", faultChainsType=" + faultChainsType +
            ", faultChainsJson=" + faultChainsJson +
            ", consequenceSorted=" + consequenceSorted +
            ", originRisk=" + originRisk +
            ", remnantRisk=" + remnantRisk +
            ", afterAdvise=" + afterAdvise +
            ", isDel=" + isDel +
            ", isTakeIn=" + isTakeIn +
            ", remark=" + remark +
            ", tenantId=" + tenantId +
            ", createTime=" + createTime +
        '}';
    }
} 